"""
Tensorflow 1.0
"""

import numpy as np
import tensorflow as tf
from python_ai.common.xcommon import *

np.set_printoptions(edgeitems=200)

cell_size = 13
box_per_cell = 5

offset = np.transpose(np.reshape(np.array([np.arange(cell_size)] * cell_size * box_per_cell),
                                         [box_per_cell, cell_size, cell_size]), (1, 2, 0))
offset_np = offset.copy()
print(offset.shape)
offset = tf.constant(offset, dtype=tf.float32)
print(offset.shape)
offset = tf.reshape(offset, [1, cell_size, cell_size, box_per_cell])
print(offset.shape)

print(offset)
print(offset_np)

sep('col offset')
offset_np = offset_np.reshape([1, cell_size, cell_size, box_per_cell])
offset_col = np.transpose(offset_np, (0, 2, 1, 3))
print(offset_col.shape)
print(offset_col)
